<template>
    <page-meta :page-style="'overflow:'+(state.popup||state.modal?'hidden':'visible')"></page-meta>
    <view class="content">
        <view class="head-wrap">
            <image src="@/static/images/bg.jpg" mode="scaleToFill" class="bg" />
            <view class="head-wrap-info">
                <view class="head-wrap-info-content">
                    <view class="head-wrap-info-content-info_wrap">
                        <view class="head-wrap-info-content-info_wrap-avatar">
                            <image :src="state.info.avatar" mode="scaleToFill" style="width: 100%;height: 100%;" />
                        </view>
                        <view class="head-wrap-info-content-info_wrap-name">{{ state.info.userName }}</view>
                        <view class="head-wrap-info-content-info_wrap-tip">30岁 硕士 6年经验 兼职</view>
                    </view>
                </view>
                <view class="head-wrap-info-step" v-if="state.info.blurbInfo">
                    <view class="head-wrap-info-step-title1">{{state.info.blurbInfo['dailyPay']||0}}/天</view>
                    <view class="head-wrap-info-step-text">
                        {{state.info.blurbInfo.wayType=='1'?'工作日':'周末'}}{{state.info.blurbInfo.startTime}}-{{
                        state.info.blurbInfo.endTime||'23:59' }}</view>
                    <view class="head-wrap-info-step-title2">
                        擅长技能
                    </view>
                    <view class="head-wrap-info-step-taglist">
                        <text class="text" v-for="(item,index) in state.info.blurbInfo.blurbSkill" :key="index">{{
                            item.label }}</text>
                    </view>
                </view>
            </view>
        </view>
        <view class="main">
            <view class="main-wrap1">
                <view class="main-wrap1-title">身份认证</view>
                <view class="main-wrap1-list">
                    <view class="main-wrap1-list-item">
                        <image :src="state.info.userTrue==1?'http://106.53.65.140:8080/upload/e13b8cce-9c35-466d-bfa2-355a5dd3ccc4.png':'http://106.53.65.140:8080/upload/a49811ae-f7d0-4ef0-be78-65f28b61209e.png'"
                            mode="scaleToFill" class="main-wrap1-list-item-img" />
                        <view class="main-wrap1-list-item-text">实名已认证</view>
                    </view>
                    <view class="main-wrap1-list-item">
                        <image  :src="state.info.usereDucationTrue==1?'http://106.53.65.140:8080/upload/90edbc4d-8484-4f69-a1c6-7bd750d75b22.png':'http://106.53.65.140:8080/upload/1168cd62-d735-4973-b79a-993699b4ed58.png'"
                            mode="scaleToFill" class="main-wrap1-list-item-img" />
                        <view class="main-wrap1-list-item-text">学历已认证</view>
                    </view>
                    <view class="main-wrap1-list-item">
                        <image :src="state.info.blurbTrue==1?'http://106.53.65.140:8080/upload/b1c4c9ed-eb30-4d7c-a6e7-3ac9fc20d533.png':'http://106.53.65.140:8080/upload/a9435fb9-7c6e-4d00-9430-08793ee9b82a.png'"
                            mode="scaleToFill" class="main-wrap1-list-item-img" />
                        <view class="main-wrap1-list-item-text">简历已认证</view>
                    </view>
                </view>
            </view>
            <view class="main-wrap2" v-if="state.info.blurbInfo.blurbSee">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">工作经历</text>
                </view>
                <view class="wrap-con">
                    <view class="wrap-con-item" v-for="(item,index) in state.info.blurbInfo.blurbSee" :key="index">
                        <view class="wrap-con-item-top">
                            <view class="wrap-con-item-top-left">
                                <view class="wrap-con-item-top-left-name">{{ item.corporateName }}</view>
                            </view>
                            <view class="wrap-con-item-top-right">
                                <view class="wrap-con-item-top-right-name">{{ item.jobName }}</view>
                            </view>
                        </view>
                        <view class="wrap-con-item-content">
                            <view class="wrap-con-item-content-time">{{item.startDate}}至{{ item.endDate }}</view>
                        </view>
                        <view class="wrap-con-item-footer">
                            <view class="wrap-con-item-footer-name">{{ item.content }}</view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="main-wrap3">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">教育经历</text>
                </view>
                <view class="wrap-con">
                    <view class="wrap-con-item" v-for="(item,index) in state.info.usereDucationList" :key="index">
                        <view class="wrap-con-item-top">
                            <view class="wrap-con-item-top-left">
                                <view class="wrap-con-item-top-left-name">{{ item.schoolName }}</view>
                                <view class="wrap-con-item-top-left-icon">
                                    <image src="@/static/images/index/auth.png" mode="scaleToFill"
                                        style="width: 100%;height: 100%;" />
                                </view>
                            </view>
                            <view class="wrap-con-item-top-right">
                                <view class="wrap-con-item-top-right-name">{{ item.educationTypeName }}</view>
                            </view>
                        </view>
                        <view class="wrap-con-item-footer">
                            <view class="wrap-con-item-footer-time">{{item.startDate}}至{{ item.endDate }}</view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="main-wrap4">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">资格证书</text>
                </view>
            </view>
            <view class="main-wrap5">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">技能标签</text>
                </view>
                <view class="wrap-con">
                    <text class="text" v-for="(item,index) in state.info.blurbInfo.blurbSkill" :key="index">{{
                        item.label }}</text>
                </view>
            </view>
            <view class="main-wrap6">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">项目作品</text>
                </view>
            </view>
            <view class="main-wrap7">
                <view class="area">
                    <view class="line"></view>
                    <text class="text">联系方式</text>
                </view>
                <view class="wrap-con">
                    <up-cell-group :border="false">
                        <up-cell title="邮箱" value="xie_0283@163.com" :border="false"></up-cell>
                        <up-cell title="手机号" value="13237976832" :border="false"></up-cell>
                    </up-cell-group>
                </view>
            </view>
        </view>
        <view class="fixed-action-wrap">
            <view class="fixed-action-wrap-icon">
                <up-button data-name="shareBtn" open-type="share">
                    <up-icon name="share-square" size="28"></up-icon>
                </up-button>
            </view>
            <view class="fixed-action-wrap-button">
                <view class="fixed-action-wrap-button-btn" @click="state.popup=true">
                    <image src="@/static/images/detail/contact.png" mode="scaleToFill"
                        style="width: 100%;height: 100%;" />
                </view>
                <view class="fixed-action-wrap-button-btn" style="margin-left: -24rpx;" @click="state.modal=true">
                    <image src="@/static/images/detail/send.png" mode="scaleToFill" style="width: 100%;height: 100%;" />
                </view>
            </view>
        </view>
        <up-popup v-model:show="state.popup" :round="24" mode="bottom" :closeable="true" @close="state.popup=false">
            <view class="popup-wrap">
                <image show-menu-by-longpress
                    src="http://106.53.65.140:8080/upload/6e51c219-d47c-45d3-9190-62145d394596.jpg" mode="scaleToFill"
                    class="qrcode" />
            </view>
        </up-popup>
        <up-modal title="确认发送合同给对方吗？" :show="state.modal" @confirm="confirm" ref="uModal" :asyncClose="true"
            :showCancelButton="true"></up-modal>
    </view>
</template>
<script setup>
import { ref, reactive, getCurrentInstance } from 'vue';
import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'

const { proxy } = getCurrentInstance()
// 使用 reactive 创建响应式状态  
const state = reactive({
    popup: false,
    modal: false,
    info: {}
});

onShareAppMessage(() => {
    console.log('点击分享')
})

function confirm() {
    state.modal = false
}

async function getDetail(id) {
    const res = await proxy.request('/pr/get', { id }, { method: "GET" })
    state.info = res.data.data
    console.log(state.info)
}
onLoad((option) => {
    console.log(option)
    getDetail(option.id)
})
</script>
<style lang="scss">
page {
    background-color: #F5F5F5;
}
</style>
<style lang="scss" scoped>
::v-deep .u-cell__body{
    padding:14rpx 14rpx !important;
}
.head-wrap {
    position: relative;

    .bg {
        width: 100%;
        margin-top: -88rpx;
    }

    &-info {
        position: absolute;
        top: 36rpx;
        left: 32rpx;
        right: 32rpx;

        &-content {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            // padding-top: 88rpx;

            &-info_wrap {
                // padding-top: 88rpx;
                display: flex;
                align-items: center;
                flex-direction: column;
                width: 100%;
                height: 100%;

                &-avatar {
                    width: 128rpx;
                    height: 128rpx;
                    border-radius: 50%;
                    border: 1px solid #ffffff;
                    overflow: hidden
                }

                &-name {
                    margin-top: 16rpx;
                    width: 100%;
                    height: 44rpx;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 500;
                    font-size: 32rpx;
                    color: #323232;
                    line-height: 38rpx;
                    text-align: center;
                    font-style: normal;
                    text-transform: none;
                }

                &-tip {
                    margin-top: 12rpx;
                    width: 100%;
                    height: 34rpx;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #FFFFFF;
                    line-height: 28rpx;
                    text-align: center;
                    font-style: normal;
                    text-transform: none;
                }
            }
        }

        &-step {
            margin-top: 44rpx;
            // height: 276rpx;
            // display: flex;
            padding: 20rpx;
            // align-items: center;
            box-sizing: border-box;
            background-color: #faefce;
            border-radius: 12rpx 12rpx 12rpx 12rpx;

            &-title1 {
                width: 100%;
                height: 68rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 600;
                font-size: 48rpx;
                color: #F2CB51;
                line-height: 56rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
            }

            &-title2 {
                margin-top: 20rpx;
                width: 100%;
                height: 44rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 32rpx;
                color: #323232;
                line-height: 38rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
            }

            &-text {
                margin-top: 8rpx;
                width: 100%;
                height: 34rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 24rpx;
                color: #A09D9D;
                line-height: 28rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
            }

            &-taglist {
                display: flex;
                align-items: center;
                margin-top: 24rpx;

                .text {
                    margin-right: 20rpx;
                    width: fit-content;
                    padding: 4rpx 20rpx;
                    height: 42rpx;
                    text-align: center;
                    line-height: 42rpx;
                    background: rgba(206, 206, 206, 0.4);
                    border-radius: 8rpx 8rpx 8rpx 8rpx;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #6D6D6D;
                    font-style: normal;
                    text-transform: none;
                }
            }
        }
    }


}

.main {
    margin-top: 188rpx;
    padding: 32rpx;
    padding-bottom: 200rpx;

    &-wrap1 {
        height: 290rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;

        &-title {
            width: 128rpx;
            height: 44rpx;
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 32rpx;
            color: #323232;
            line-height: 38rpx;
            text-align: left;
            font-style: normal;
            text-transform: none;
        }

        &-list {
            margin-top: 54rpx;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 30rpx;

            &-item {
                text-align: center;

                &-img {
                    width: 80rpx;
                    height: 80rpx;
                    border-radius: 50%;
                }

                &-text {
                    margin-top: 20rpx;
                    width: 140rpx;
                    height: 40rpx;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 28rpx;
                    color: #323232;
                    line-height: 33rpx;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;
                }
            }
        }
    }

    &-wrap2 {
        margin-top: 32rpx;
        // height: 444rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;

        .wrap-con {
            margin-top: 24rpx;

            &-item {
                width: 100%;
                height: 134rpx;

                &-top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    height: 40rpx;

                    &-left {

                        &-name {
                            width: 100%;
                            height: 40rpx;
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 500;
                            font-size: 28rpx;
                            color: #323232;
                            line-height: 40rpx;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }

                        &-time {
                            width: 100%;
                            height: 34rpx;
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 400;
                            font-size: 24rpx;
                            color: #A09D9D;
                            line-height: 28rpx;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }
                    }

                    &-right {
                        &-name {
                            width: 100%;
                            height: 40rpx;
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 400;
                            font-size: 28rpx;
                            color: #323232;
                            line-height: 33rpx;
                            text-align: right;
                            font-style: normal;
                            text-transform: none;
                        }
                    }
                }

                &-content {
                    &-time {
                        width: 100%;
                        height: 34rpx;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #A09D9D;
                        line-height: 28rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                }

                &-footer {
                    margin-top: 20rpx;

                    &-name {
                        width: 100%;
                        height: 40rpx;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 28rpx;
                        color: #323232;
                        line-height: 33rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                }
            }
        }
    }

    &-wrap3 {
        margin-top: 32rpx;
        // height: 208rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;

        .wrap-con {
            margin-top: 24rpx;

            &-item {
                width: 100%;
                height: 100rpx;

                &-top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    height: 40rpx;

                    &-left {
                        display: flex;
                        align-items: center;
                        flex: 0 0 50%;
                        &-name {
                            width: fit-content;
                            height: 40rpx;
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 500;
                            font-size: 28rpx;
                            color: #323232;
                            line-height: 33rpx;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }

                        &-icon {
                            margin-left: 22rpx;
                            width: 76rpx;
                            height: 36rpx;
                        }
                    }

                    &-right {
                        &-name {
                            width: 56rpx;
                            height: 40rpx;
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 400;
                            font-size: 28rpx;
                            color: #323232;
                            line-height: 33rpx;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }
                    }
                }

                &-footer {
                    margin-top: 6rpx;

                    &-time {
                        width: 100%;
                        height: 34rpx;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #A09D9D;
                        line-height: 28rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                }
            }
        }
    }

    &-wrap4 {
        margin-top: 32rpx;
        height: 112rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;
    }

    &-wrap5 {
        margin-top: 32rpx;
        height: 158rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;

        .wrap-con {
            display: flex;
            align-items: center;
            margin-top: 24rpx;

            .text {
                margin-right: 20rpx;
                width: fit-content;
                padding: 4rpx 20rpx;
                height: 42rpx;
                text-align: center;
                line-height: 42rpx;
                background: rgba(206, 206, 206, 0.4);
                border-radius: 8rpx 8rpx 8rpx 8rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 24rpx;
                color: #6D6D6D;
                font-style: normal;
                text-transform: none;
            }
        }
    }

    &-wrap6 {
        margin-top: 32rpx;
        height: 112rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;
    }
    &-wrap7 {
        margin-top: 32rpx;
        // height: 112rpx;
        background: #FFFFFF;
        padding: 20rpx;
        box-sizing: border-box;
        border-radius: 12rpx 12rpx 12rpx 12rpx;
    }

    .area {
        display: flex;
        align-items: center;

        .line {
            width: 8rpx;
            height: 32rpx;
            background: #F2CB51;
            border-radius: 12rpx 12rpx 12rpx 12rpx;
        }

        .text {
            margin-left: 20rpx;
            width: 128rpx;
            height: 44rpx;
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 32rpx;
            color: #323232;
            line-height: 38rpx;
            text-align: left;
            font-style: normal;
            text-transform: none;
        }
    }
}

.popup-wrap {
    padding: 24rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    .qrcode {
        width: 380rpx;
        height: 360rpx;
    }
}

.fixed-action-wrap {
    position: fixed;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 128rpx;
    padding: 32rpx;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;


    &-button {
        display: flex;
        align-items: center;
        justify-content: center;

        &-icon {
            ::v-deep uni-button {
                background-color: transparent;
                border: none;
            }
        }

        &-btn {
            width: 252rpx;
            height: 80rpx;
            // background: #F2CB51;
            border-radius: 8rpx 8rpx 8rpx 8rpx;
        }
    }
}
</style>